#pragma once

#include <map>

enum EMainTabs
{
  tabFavorites  = 0,
  tabCallLog    = 1,
  tabContacts   = 2,

  tabCount
};

enum CallType
{
  ctAll      = 0,
  ctMissed   = 1,
  ctIncoming = 2,
  ctOutgoing = 3,

  ctCount,
  ctNone
};

enum MenuCommandFlags
{
  CMDF_MENU_CLICK   = 0x00,
  CMDF_MENU_LONGTAP = 0x02
};

enum MenuCommands
{
  CMD_NONE           = 0,
  // list
  CMD_LIST_FAVORITES = 1,
  CMD_LIST_CALLLOG   = 2,
  CMD_LIST_CONTACTS  = 3,
  CMD_LIST_DIALER    = 4,
  CMD_LIST_KEYBOARD  = 5,
  // Details
  CMD_DETAILS_BACK   = 6,
  // Poom Details
  CMD_DETAILS_VIEW   = 7,
  CMD_DETAILS_EDIT   = 8,
  CMD_DETAILS_DELETE = 9,
  CMD_DETAILS_FAVORITE = 10,
  // Call Log Details
  CMD_DETAILS_CL_NEWCONTACT   = 11,
  CMD_DETAILS_CL_GOTOCONTACT  = 12,
  CMD_DETAILS_CL_DELETECALL   = 13,
  // Sim Contact Details
  CMD_DETAILS_SIM_NEWCONTACT  = 14,
  CMD_DETAILS_SIM_GOTOOUTLOOK = 15,
  // Contact Picture
  CMD_DETAILS_SET_PICTURE     = 16,

  CMD_LIST_SHOW_DETAILS     = 17,
  CMD_LIST_SET_CATEGORY     = 18,
  CMD_LIST_HIDE_CATEGORIES  = 19,
  // Contact Ringtone
  CMD_DETAILS_SET_RINGTONE  = 20,

  CMD_LAST
};

#ifdef _DEBUG
extern LRESULT SendMessageDbg(HWND, UINT, WPARAM, LPARAM);
extern LRESULT PostMessageDbg(HWND, UINT, WPARAM, LPARAM);
#define SendCommand(hWnd, nCmd)         SendMessageDbg(hWnd, WM_COMMAND, MAKEWPARAM(nCmd, 0), 0)
#define SendCommandF(hWnd, nCmd, nFlag) SendMessageDbg(hWnd, WM_COMMAND, MAKEWPARAM(nCmd, nFlag), 0)
#define PostCommand(hWnd, nCmd)         PostMessageDbg(hWnd, WM_COMMAND, MAKEWPARAM(nCmd, 0), 0)
#define PostCommandF(hWnd, nCmd, nFlag) PostMessageDbg(hWnd, WM_COMMAND, MAKEWPARAM(nCmd, nFlag), 0)
#else
#define SendCommand(hWnd, nCmd)         ::SendMessage(hWnd, WM_COMMAND, MAKEWPARAM(nCmd, 0), 0)
#define SendCommandF(hWnd, nCmd, nFlag) ::SendMessage(hWnd, WM_COMMAND, MAKEWPARAM(nCmd, nFlag), 0)
#define PostCommand(hWnd, nCmd)         ::PostMessage(hWnd, WM_COMMAND, MAKEWPARAM(nCmd, 0), 0)
#define PostCommandF(hWnd, nCmd, nFlag) ::PostMessage(hWnd, WM_COMMAND, MAKEWPARAM(nCmd, nFlag), 0)
#endif

// TIMERS
#define IDT_TIMER_TRANSITION        10010
#define IDT_TIMER_MENU_LONGTAP      10011
#define IDT_TIMER_SEARCHKBD_LAYOUT  10050
#define IDT_TIMER_RELOAD            10089 // Avian
#define IDT_TIMER_HIDE_SIP          10099 // Avian


// CONTROLS
#define IDC_SEARCH_EDIT_BOX         1001

//
// Common Notification Messages
//
// Notification of thread having tasks:
// lParam == TRUE - has tasks, FALSE - no more tasks
#define NM_THREAD_BUSY          (WM_USER + 1)

// Notification to update progress for 'busy' state
// lParam is an int between 0 and 100 %
#define NM_UPDATE_BUSY_PROGRESS (WM_USER + 2)

//
// TitleBar Notification Messages
//

// Window Message for notifications of changes
#define NM_TITLEBAR            (WM_USER + 10)

//
// Call Info Notification Messages
//

#define NM_CALLINFO            (WM_USER + 20)

//
// PoomPictures Notification Messages
//

// Picture Loaded
// passes oId of the item in wParam
#define NM_POOM_PICTURE_LOADED (WM_USER + 30)

//
// SimManager Notification Messages
//
// Contacts Loaded
#define NM_SIM_MANAGER_CONTACTS_LOADED (WM_USER + 40)
// Contact Created
#define NM_SIM_MANAGER_CONTACT_CREATED (WM_USER + 41)
// Contact Deleted
#define NM_SIM_MANAGER_CONTACT_DELETED (WM_USER + 42)

//
// Search Keyboard Notification Messages
//
// String Updated: wParam is the const TCHAR* string, lParam is int stringLen
#define NM_SKK_STRING_UPDATED          (WM_USER + 50)
// Mode Changed, need to update list rect (wParam is SearchKbdMode currMode, lParam is RECT* newRect)
#define NM_SKK_MODE_CHANGED            (WM_USER + 51)
// Closed
#define NM_SKK_CLOSE                   (WM_USER + 52)


//
// Information requests
//
// returns the number of the tab
#define WM_GET_CURRENT_TAB             (WM_USER + 60)
// returns the type of displayed calls
#define WM_GET_CALL_TYPE               (WM_USER + 61)
// returns the CListBase* to contacts list
#define WM_GET_CONTACTS_LIST           (WM_USER + 62)

#define Info_GetCurrentTab(hWnd)       (EMainTabs)::SendMessage(hWnd, WM_GET_CURRENT_TAB, 0, 0)
#define Info_GetCallType(hWnd)         (CallType)::SendMessage(hWnd, WM_GET_CALL_TYPE, 0, 0)
#define Info_GetContactsList(hWnd)     (CListBase*)::SendMessage(hWnd, WM_GET_CONTACTS_LIST, 0, 0)
